﻿using MediatR;
using SystemLYH.API.Application.Command.ProcuredCommand;
using SystemLYH.Domain;
using SystemLYH.Infrstructre.Impl;
using SystemLYH.Infrstructre.Interface;

namespace SystemLYH.API.Application.Handlers.ProcuredHandlers
{
	public class ProcuredBackfiiHandlers : IRequestHandler<ProcuredBackfillCommand, Procuredrequest>
	{
		protected readonly IProcuredrequestRepository _procuredrequestRepository;
		/// <summary>
		/// 采购申请构造函数
		/// </summary>
		/// <param name="procuredrequestRepository"></param>
		public ProcuredBackfiiHandlers(IProcuredrequestRepository procuredrequestRepository)
		{
			_procuredrequestRepository = procuredrequestRepository;
		}
		public async Task<Procuredrequest> Handle(ProcuredBackfillCommand request, CancellationToken cancellationToken)
		{
			return await _procuredrequestRepository.GetAsync(request.ProcuredId);
		}
	}
}
